home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / t_unix / j109lxa4.tar / session.h < prev    next >
C/C++ Source or Header  |  1994-06-04  |  3KB  |  110 lines

  1. /* Mods by PA0GRI */
  2. #ifndef _SESSION_H
  3. #define _SESSION_H
  4.  
  5. #include <stdio.h>
  6.  
  7. #ifndef _GLOBAL_H
  8. #include "global.h"
  9. #endif
  10.  
  11. #ifndef _PROC_H
  12. #include "proc.h"
  13. #endif
  14.  
  15. #ifndef _HARDWARE_H
  16. #include "hardware.h"
  17. #endif
  18.  
  19.  
  20. #ifndef _FTPCLI_H
  21. #include "ftpcli.h"
  22. #endif
  23.  
  24. #ifndef _TELNET_H
  25. #include "telnet.h"
  26. #endif
  27.  
  28. #define MOREROWS        24      /* rows on screen before --more-- */
  29.  
  30. struct ttystate {
  31.     struct mbuf *line;      /* Line buffer */
  32.     int echo;               /* Keyboard local echoing? */
  33.     int edit;               /* Local editing? */
  34.     int crnl;               /* Translate cr to lf? */
  35. };
  36.  
  37. /* Session control structure; only one entry is used at a time */
  38. struct session {
  39.     int type;
  40. #define FREE    0
  41. #define TELNET  1
  42. #define FTP     2
  43. #define AX25TNC 3
  44. #define FINGER  4
  45. #define PING    5
  46. #define NRSESSION 6
  47. #define COMMAND 7
  48. #define MORE    8
  49. #define HOP     9
  50. #define TIP     10
  51. #define PPPPASS 11
  52. #define DIAL    12
  53. #define DQUERY  13
  54. #define DCLIST  14
  55. #define RLOGIN  15
  56. #define REPEAT  16
  57. #define TRACESESSION 17
  58.  
  59.     char *name;     /* Name of remote host */
  60.     union {
  61.         struct ftpcli *ftp;
  62.         struct telnet *telnet;
  63.     } cb;
  64.     struct proc *proc;      /* Primary session process (e.g., tn recv) */
  65.     struct proc *proc1;     /* Secondary session process (e.g., tn xmit) */
  66.     struct proc *proc2;     /* Tertiary session process (e.g., upload) */
  67.     int s;                  /* Primary network socket (control for FTP) */
  68.     FILE *record;           /* Receive record file */
  69.     char *rfile;            /* Record file name */
  70.     FILE *upload;           /* Send file */
  71.     char *ufile;            /* Upload file name */
  72.     struct ttystate ttystate;
  73.     struct screen *screen;
  74.     int input;              /* Input socket */
  75.     int output;             /* Output socket */
  76.     int flowmode;           /* control "more" mode */
  77.     int row;                /* Rows remaining until "more" */
  78.     int morewait;           /* Output driver is waiting on us */
  79.     int tsavex;             /* Save for x top screen */
  80.     int tsavey;             /* Save for y top screen */
  81.     int bsavex;             /* Save for x bottom screen */
  82.     int bsavey;             /* Save for y bottom screen */
  83.     int split;              /* Signal for split screen */
  84.     struct cur_dirs *curdirs; 
  85. };      
  86. #define NULLSESSION     (struct session *)0
  87.  
  88. extern char *Sestypes[];
  89. extern unsigned Nsessions;              /* Maximum number of sessions */
  90. extern struct session *Sessions;        /* Session descriptors themselves */
  91. extern struct session *Current;         /* Always points to current session */
  92. extern struct session *Lastcurr;        /* Last non-command session */
  93. extern struct session *Command;         /* Pointer to command session */
  94.  
  95. /* In session.c: */
  96. void freesession __ARGS((struct session *sp));
  97. struct session *sessptr __ARGS((char *cp));
  98. struct session *newsession __ARGS((char *name,int type,int split));
  99. void upload __ARGS((int unused,void *sp1,void *p));
  100. extern char TooManySessions[];
  101.  
  102. /* In pc.c: */
  103. void swapscreen __ARGS((struct session *old,struct session *new));
  104.  
  105. extern int16 Lport;
  106. #define ALERT_EOF       1
  107.  
  108.  
  109. #endif  /* _SESSION_H */
  110.